/**
 * Created by yermek on 2018/01/05.
 */
    //轮播插件控制
function lond(id, tag1,  tag2) {
    var oTab = document.getElementById(id);
    var aH4 = oTab.getElementsByTagName(tag1);
    var aDiv = oTab.getElementsByTagName(tag2);

    for (var i = 0; i < aH4.length; i++) {
        aH4[i].index = i;
        aH4[i].onclick = function () {
            for (var i = 0; i < aH4.length; i++) {
                aH4[i].className = "";
                aDiv[i].style.display = "none";
            }
            this.className = "active";
            aDiv[this.index].style.display = "block";
        };
    }
}

var mySwiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        loop: true,
        speed: 30000,
        autoplay: 2000,
        grabCursor: true,
        paginationClickable: false
    });
//Tab切换
lond("tab2", "h4", "ul");

jQuery(function ($) {
    $('#ad-contents').slideBox();
});

//    页面所需jq
$(document).ready(function () {
    $('.cx').mouseover(function () {
        $(this).addClass("god").siblings().removeClass("god");
    });
    $('.xhcx').mouseout(function () {
        $(this).children($(".cx")).removeClass("god");
    });
    $(' #navigation li').click(function () {
        $(this).addClass("hover").siblings().removeClass("hover")
    });

    $(" #tab li").click(function () {
        $(this).addClass("hover").siblings().removeClass("hover")
    });
    //点击左侧箭头切换图片
//        $('.arrow-left').on('click', function (e) {
//
//
//        });
    $('.arrow-left').click(function (e) {
        e.preventDefault();
        mySwiper.swipeNext()
    });
    $('.arrow-right').click(function (e) {
        e.preventDefault();
        mySwiper.swipePrev()
    });

});
